package com.ctsi.ssdc.admin.repository.oracle;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.SelectKey;
import org.springframework.stereotype.Repository;

import com.ctsi.ssdc.admin.domain.CscpLogOperation;
import com.ctsi.ssdc.admin.repository.CscpLogOperationRepository;
import com.ctsi.ssdc.admin.repository.CscpLogOperationSqlProvider;

/**
 * @author MyBatis Generator
*/
public interface CscpLogOperationRepositoryForOracle extends CscpLogOperationRepository{

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_log_operation
     *
     * @mbg.generated Thu Aug 02 11:13:47 CST 2018
     */
    @Insert({
        "insert into cscp_log_operation (id, userid, username, ",
        "uri, ip, params, ",
        "method, message, ",
        "status, time, error)",
        "values (#{id,jdbcType=INTEGER}, #{userid,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, ",
        "#{uri,jdbcType=VARCHAR}, #{ip,jdbcType=VARCHAR}, #{params,jdbcType=VARCHAR}, ",
        "#{method,jdbcType=VARCHAR}, #{message,jdbcType=VARCHAR}, ",
        "#{status,jdbcType=CHAR}, #{time,jdbcType=TIMESTAMP}, #{error,jdbcType=VARCHAR})"
    })
    @SelectKey(statement="select SEQ_CSCP_LOG_OPERATION_ID.nextval as id from dual", keyProperty="id", before=true, resultType=Integer.class)
    int insert(CscpLogOperation record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_log_operation
     *
     * @mbg.generated Thu Aug 02 11:13:47 CST 2018
     */
    @InsertProvider(type=CscpLogOperationSqlProvider.class, method="insertSelective")
    @SelectKey(statement="select SEQ_CSCP_LOG_OPERATION_ID.nextval as id from dual", keyProperty="id", before=true, resultType=Integer.class)
    int insertSelective(CscpLogOperation record);

}